﻿using System;
namespace PaperMaster.Utility.Event
{
    /// <summary>
    /// 事件函数基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class Event<T> where T : Event<T>
    {
        private static Action actions;
        public static void Register(Action action)
        {
            actions += action;
        }
        public static void Unregister(Action action)
        {
            actions -= action;
        }
        public static void Trigger()
        {
            actions?.Invoke();
        }
    }
}
